<include file="Public/header" />
<title>编辑购买人</title>
</head>
<body>
<div class="pd-20">
<form action="__URL__/add_goods" name="postForm" id="postForm" method="post" >
	<table class="table table-border table-bordered table-bg">
		<input type="hidden" name="id" class="input-text" value="<{$detail.id}>">
		<tbody>
			<tr class="text-c">
				<td width="15%" class="text-r" style="background-color:#f5f5f5">购买人姓名</td>
				<td class="text-l" width="35%">
					<input type="text"  name="buyer_name" class="input-text" value="<{$detail.buyer_name}>" >
				</td>
				<td width="15%" class="text-r" style="background-color:#f5f5f5">购买人身份证</td>
				<td class="text-l">
					<input type="text" name="buyer_idcard" class="input-text" value="<{$detail.buyer_idcard}>" >
				</td>
			</tr>
		</tbody>
	</table>
	<input type="button" class="btn btn-primary radius mt" onclick="confirm_edit_buyer()" value="更新">
</form>
</div>
<script type="text/javascript" src="__PUBLIC__/js/jquery.form.js"></script>
<script>
	function confirm_edit_buyer(){
			id=<{:I('id')}>;
			username="<{:I('username')}>";
			buyer_name=$('input[name=buyer_name]').val();
			buyer_idcard=$('input[name=buyer_idcard]').val();
			$.ajax({
				type: 'POST',
				data: {id:id,buyer_idcard:buyer_idcard,buyer_name:buyer_name,username:username},
				url: "<{:U('confirm_edit_buyer')}>",
				success:function(data){
					if(data.status==1){	
						layer.msg(data.message,function(){
							parent.window.location.href =parent.window.location.href;
						});
					}else{
						layer.msg(data.message);
					}
					return false;
				}
			})
	}

</script>
</body>
</html>